import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.UIManager;
import javax.swing.SwingConstants;
import java.awt.Toolkit;


@SuppressWarnings("unused")
public class Juego extends JFrame {
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception e){
			System.out.println("Error setting native LAF: "+e);
		}
	
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Juego frame = new Juego();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Juego() {
		setResizable(false);
		setIconImage(Toolkit.getDefaultToolkit().getImage(Juego.class.getResource("/imagenes/Logo_UNGS-recorte.png")));
		setTitle("Akinator-Animal");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 830, 670);
		contentPane = new JPanel();
		contentPane.setBackground(Color.WHITE);
		contentPane.setBorder(null);
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnNewButton = new JButton("Cancelar");
		btnNewButton.setBorderPainted(false);
		btnNewButton.setBorder(null);
		btnNewButton.setForeground(Color.RED);
		btnNewButton.setBackground(new Color(255, 255, 255));
		btnNewButton.setToolTipText("Click para salir del Juego");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0);
			}
		});
		
		JButton btnNewButton_1 = new JButton("Listo");
		btnNewButton_1.setBorderPainted(false);
		btnNewButton_1.setBorder(null);
		btnNewButton_1.setFont(new Font("Dialog", Font.BOLD, 16));
		btnNewButton_1.setForeground(Color.GREEN);
		btnNewButton_1.setBackground(new Color(255, 255, 255));
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Preguntas pregunta= new Preguntas();
				pregunta.setVisible(true);
				// centrado respecto del padre
				pregunta.setLocationRelativeTo(contentPane);
				setVisible(false);
			}
		});
		
		JLabel lblNewLabel_1 = new JLabel("Ok! Piensa en uno de estos animales");
		lblNewLabel_1.setForeground(Color.BLACK);
		lblNewLabel_1.setFont(new Font("DejaVu Serif", Font.BOLD, 24));
		lblNewLabel_1.setBounds(57, 30, 534, 75);
		contentPane.add(lblNewLabel_1);
		btnNewButton_1.setBounds(660, 492, 117, 25);
		contentPane.add(btnNewButton_1);
		btnNewButton.setBounds(660, 556, 117, 25);
		contentPane.add(btnNewButton);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon(Juego.class.getResource("/imagenes/animales640x480n2.png")));
		label.setBounds(37, 144, 554, 480);
		contentPane.add(label);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon(Juego.class.getResource("/imagenes/akinator200x300.png")));
		lblNewLabel.setBounds(608, 137, 206, 288);
		contentPane.add(lblNewLabel);
		
		JLabel lblFondo = new JLabel("");
		lblFondo.setIcon(new ImageIcon(Principal.class.getResource("/imagenes/desierto2.png")));
		lblFondo.setBounds(0, 0, 830, 670);
		getContentPane().add(lblFondo);
		// frame al centro de la pantalla
		setLocationRelativeTo(null);
	}
}
